﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Bon.It.Server.Interfaces;
using Bon_It.Model;

namespace Bon.It.Server
{
    public partial class ContractManager : IGebinde
    {

        /// <summary>
        /// he Gebinde ident for "stck".
        /// </summary>
        public const long GEBINDES_STCK=1;

        #region Implementation of IGebinde

        
        public Gebinde[] GetAllGebinde()
        {
            using (var context = GetDataContext())
            {
                return context.Gebinde.ToArray();
            }
        }

        #endregion

        /// <summary>
        /// Gets the gebinde by id.
        /// </summary>
        /// <param name="id">The id.</param>
        /// <returns></returns>
        private Gebinde GetGebindeById(long id)
        {
            using (var context = GetDataContext())
            {
                return context.Gebinde.FirstOrDefault(i => i.ID == id);
            }
        }
    }
}
